

async function async2() {
  console.log('async2')
}

async function async1() {
  console.log('async1')
  await async2();
  // await 后面的代码在async2中的then后面执行
  console.log('对比promise2，看谁快')
}

console.log('script start');

setTimeout(()=>{
  console.log('set timeout.')
},0);

async1();

new Promise((resolve,reject)=>{
  console.log('promise1')
  resolve();

}).then(()=>{
  console.log('promise2')
})
console.log('script end')
